home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / FWBTxtSh.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.8 KB  |  111 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWBTxtSh.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9. //
  10. //    Class Definitions for
  11. //            - FW_CBaseTextShape
  12. //
  13.  
  14. #ifndef FWBTXTSH_H
  15. #define FWBTXTSH_H
  16.  
  17. #ifndef FWSHAPE_H
  18. #include "FWShape.h"
  19. #endif
  20.  
  21. #ifndef FWSTDDEF_H
  22. #include "FWStdDef.h"
  23. #endif
  24.  
  25. #ifndef FWSTRS_H
  26. #include "FWStrs.h"
  27. #endif
  28.  
  29. // ----- Macintosh Includes -----
  30.  
  31. #if defined(FW_BUILD_MAC) && !defined(__TEXTEDIT__)
  32. #include <TextEdit.h>
  33. #endif
  34.  
  35. //========================================================================================
  36. //    Forward Declarations
  37. //========================================================================================
  38.  
  39. class FW_CGraphicContext;
  40. class FW_CTextReader;
  41. class FW_CPrivTextBuffer;
  42.  
  43. //========================================================================================
  44. //    class FW_CBaseTextShape
  45. //========================================================================================
  46.  
  47. class FW_CBaseTextShape : public FW_CShape
  48. {
  49. public:
  50.     FW_DECLARE_CLASS
  51.     FW_DECLARE_AUTO(FW_CBaseTextShape)
  52.  
  53. //----------------------------------------------------------------------------------------
  54. //    Constructors/Destructors
  55. //
  56. public:
  57.     FW_CBaseTextShape();
  58.     FW_CBaseTextShape(const FW_CString& string,
  59.                       const FW_CInk& ink,
  60.                       const FW_CFont& font);
  61.  
  62.     FW_CBaseTextShape(FW_CTextReader& textReader,
  63.                       const FW_CInk& ink,
  64.                       const FW_CFont& font);
  65.     
  66.     FW_CBaseTextShape(FW_CReadableStream& stream);
  67.     FW_CBaseTextShape(const FW_CBaseTextShape& other);
  68.  
  69.     virtual ~ FW_CBaseTextShape();
  70.     
  71. //----------------------------------------------------------------------------------------
  72. //    Operators
  73. //
  74. public:
  75.     FW_CBaseTextShape& operator=(const FW_CBaseTextShape& other);
  76.     
  77. //----------------------------------------------------------------------------------------
  78. //    Inherited API
  79. //
  80. public:
  81.     // ----- Hit Testing -----
  82.     virtual FW_Boolean HitTest(FW_CGraphicContext& gc,
  83.                                 const FW_CPoint& test,
  84.                                 FW_Fixed tolerance) const;
  85.  
  86.     // ----- Flatten -----
  87.     virtual void        Flatten(FW_CWritableStream& stream) const;
  88.  
  89. //----------------------------------------------------------------------------------------
  90. //    New API
  91. //
  92. public:
  93.     // ----- Geometry -----
  94.     void                GetString(FW_CString& string) const
  95.                             {string = fString;}
  96.     void                SetString(const FW_CString& string)
  97.                             {fString = string;}
  98.  
  99.     void                GetText(FW_CTextWriter& textWriter) const;
  100.     void                SetText(FW_CTextReader& textReader);
  101.     
  102. //----------------------------------------------------------------------------------------
  103. //    Data Members
  104. //
  105. protected:
  106.     FW_CString        fString;
  107. };
  108.  
  109.  
  110. #endif
  111.